﻿#ifndef SIGNINWINDOWS_H
#define SIGNINWINDOWS_H

#include "networkcommunication.h"

#include <QMainWindow>
#include <QFile>
#include <QTimer>

namespace Ui {
class signinwindows;
}

class signinwindows : public QMainWindow
{
    Q_OBJECT


public:
    explicit signinwindows(QWidget *parent = nullptr);
    ~signinwindows();

private slots:
    void on_pushButton_showpasswd_pressed();

    void on_pushButton_showpasswd_released();

    void on_checkBox_autosignin_stateChanged(int arg1);

    void on_pushButton_signin_clicked();
    void signin_req(const QByteArray &mess);

    void on_pushButton_signup_clicked();

    void on_pushButton_forgetpasswd_clicked();
//    void setInterrupt();

private:
    Ui::signinwindows *ui;
    QFile *historyfile;
    QFile *lastuserfile;
    QTimer *signin_timer;
    QTcpSocket *server;
    NetworkConnect *net;

    void init_interface();
    bool openfile();
    bool isInterrupted;
    int wrongtimes;
};

#endif // SIGNINWINDOWS_H
